<template>
  <t-dialog
    :visible="props.visibles"
    width="50%"
    header="查看文件存储信息表"
    :destroy-on-close="true"
    :footer="false"
    @cancel="handleClose"
    @close="handleClose"
  >
    <div class="info-wrapper" :class="`sys-style-${systemStyle}`">
      <div class="info-inner-subtitle">
        <div class="info-inner-subtitle-rectangle"></div>
        <p>基础信息</p>
      </div>
      <div class="descriptions">
                  <div class="des">
            <div class="title">文件名称</div>
            <p>{{ information.fileName }}</p>
          </div>
                  <div class="des">
            <div class="title">上传时间</div>
            <p>{{ information.uploadTime }}</p>
          </div>
                  <div class="des">
            <div class="title">上传人</div>
            <p>{{ information.uploadId }}</p>
          </div>
                  <div class="des">
            <div class="title">上传人姓名</div>
            <p>{{ information.uploadName }}</p>
          </div>
                  <div class="des">
            <div class="title">存储路径</div>
            <p>{{ information.path }}</p>
          </div>
                  <div class="des">
            <div class="title">创建时间</div>
            <p>{{ information.createDate }}</p>
          </div>
                  <div class="des">
            <div class="title">创建人</div>
            <p>{{ information.createId }}</p>
          </div>
                  <div class="des">
            <div class="title">更新时间</div>
            <p>{{ information.updateDate }}</p>
          </div>
                  <div class="des">
            <div class="title">修改人</div>
            <p>{{ information.updateId }}</p>
          </div>
              </div>
    </div>
  </t-dialog>
</template>
<script lang="ts" setup>
import moment from 'moment';
import { computed, onMounted, ref } from 'vue';

import {getList, getInfo, doDelete, doUpdate, doCreate } from '@/api/platform/waterquality/file/info';
import { useSettingStore } from '@/store';

const settingStore = useSettingStore();
const systemStyle = computed(() => {
  return settingStore.getThemeStyle;
});

const props = defineProps({
  visibles: {
    type: Boolean,
    default: false,
  },
  information: {
    type: Object,
    default: () => {
      return {};
    },
  },
});

onMounted(() => {
  fetchData();
});


const fetchData = () => {
  getInfo().then((res) => {
    category.value = res;
  });
};

const emit = defineEmits(['update:visibles']);

const handleClose = () => {
  emit('update:visibles', false);
};
</script>
<style lang="less" scoped>
.info-wrapper.sys-style-light {
  .info-inner-subtitle {
    background-image: url('@/assets/subtitle-bg-light.svg');
  }
}
.info-wrapper.sys-style-red {
  .info-inner-subtitle {
    background-image: url('@/assets/subtitle-bg-red.svg');
  }
}
.info-wrapper {
  padding: var(--td-comp-paddingTB-l) var(--td-comp-paddingLR-l);
  .info-inner-subtitle {
    width: 100%;
    padding: 10px 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 10px;
    background-size: 200px 100%;
    background-repeat: no-repeat;
    &-rectangle {
      width: 4px;
      height: 16px;
      border-radius: 24px;
      background: linear-gradient(180deg, var(--td-brand-color-7), var(--td-brand-color-3));
      margin-left: 12px;
      margin-right: 8px;
    }
    p {
      line-height: 24px;
      font-size: 16px;
      font-weight: 700;
    }
  }
  .descriptions {
    font-size: 16px;
    width: calc(100% - 64px);
    display: flex;
    flex-direction: row;
    align-items: start;
    flex-wrap: wrap;
    margin-top: 12px;

    > .des {
      width: 50%;
      display: flex;
      align-items: start;
      margin-bottom: 16px;
      > .title {
        width: 20%;
        text-align: end;
        color: rgba(0, 0, 0, 0.6);
        margin-right: 30px;
      }
      > p {
        max-width: 70%;
        word-break: break-all;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
      }
      > .triple-line {
        -webkit-line-clamp: 3;
      }
    }
  }
}
</style>
